package com.kayt.cyberBar.cpublic.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.PageData;
import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.cpublic.business.entity.po.CPublicLabl;
import com.kayt.cyberBar.cpublic.business.entity.req.vo.PublicLablReqVO;
import com.kayt.cyberBar.cpublic.business.entity.rsp.vo.PublicLablRspVO;
import com.kayt.cyberBar.cpublic.business.server.IPublicLablServer;
import com.kayt.cyberBar.cpublic.business.service.IPublicLablService;

@Service("publicLablService")
public class PublicLablServiceImpl implements IPublicLablService{
	@Autowired
	private IPublicLablServer publicLablServer;
	@Override
	public ServerResponse<PageData<PublicLablRspVO>> getLablList() {
		PageData<CPublicLabl> lablPageData = publicLablServer.get_labl_list();
		return publicLablServer.assemble_result_list(lablPageData);
	}

	@Override
	public ServerResponse<PublicLablRspVO> addLabl(PublicLablReqVO lablReqVO) {
		CPublicLabl labl = publicLablServer.add_labl(lablReqVO);
		return publicLablServer.assemble_result(labl);
	}

	@Override
	public ServerResponse<PublicLablRspVO> updateLabl(PublicLablReqVO lablReqVO) {
		CPublicLabl labl = publicLablServer.mod_labl(lablReqVO);
		return publicLablServer.assemble_result(labl);
	}

	@Override
	public ServerResponse<String> deleteLabl(String lablId) {
		Integer result = publicLablServer.del_labl(lablId);
		return publicLablServer.assemble_result_string(result);
	}
}
